package com.supermarket.manage.common.utils;

import java.util.Random;

/**
 * @author Faxon
 * @version 1.0
 * @date 2020-03-03 18:33
 **/
public class CodeUtil {

    /**
     * 获取 6 位 随机验证码
     *
     * @return
     */
    public static String getCode() {
        StringBuilder code = new StringBuilder();
        Random random = new Random();
        for (int i = 0; i < 6; i++) {
            code.append(random.nextInt(10));
        }
        return code.toString();
    }
}
